package com.cxl.price.bean;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import com.summer.core.common.BeanName;
import com.summer.core.entity.BaseBean;

@Entity
@BeanName("产品 品牌")
public class Brand extends BaseBean{

	private static final long serialVersionUID = -1756537880426386808L;
	private ItemCat itemCat;
	
	private Set<Model> models;
	
	@ManyToOne(cascade=CascadeType.REFRESH,fetch = FetchType.LAZY)
	@JoinColumn(name = "itemCat_id")
	public ItemCat getItemCat() {
		return itemCat;
	}
	
	public void setItemCat(ItemCat itemCat) {
		this.itemCat = itemCat;
	}
	
	
	@OneToMany(mappedBy = "brand", fetch = FetchType.LAZY)
	public Set<Model> getModels() {
		return models;
	}

	
	public void setModels(Set<Model> models) {
		this.models = models;
	}



	private Long pid;
	
	private Long vid;
	
	private String name;
	
	private int sort;//品牌排序，好取得型号
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public Long getVid() {
		return vid;
	}

	public void setVid(Long vid) {
		this.vid = vid;
	}

	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}
	
	
	

}
